﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using QL_KhachSan.App_Code.BUS;
using QL_KhachSan.App_Code.OBJ;

namespace QL_KhachSan.App_Code.DAL
{
    class DAL_Hopdong
    {
        db_Connection dbcon;
        public DAL_Hopdong() {
            dbcon = new db_Connection();
        }
        public void add_hd(Hopdong hd) {
            SqlParameter[] p = new SqlParameter[10];
            p[0] = new SqlParameter("@mahd", hd._mahd);
            p[1] = new SqlParameter("@makh", hd._makh);
            p[2] = new SqlParameter("@sophong", hd._sophong);
            p[3] = new SqlParameter("@thoigianthue", hd._thoigianthue);
            p[4] = new SqlParameter("@tenhinhthuctra", hd._hinhthuctra);
            p[5] = new SqlParameter("@tenkh", hd._tenkh);
            p[6] = new SqlParameter("@tuoi", hd._tuoi);
            p[7] = new SqlParameter("@diachi", hd._diachi);
            p[8] = new SqlParameter("@socmt", hd._socmt);
            p[9] = new SqlParameter("@sdt", hd._sdt);
            dbcon.exe_proc_para("add_hopdong", p);
        }
        public void delete_hd(string query, SqlParameter[] p)
        {
            dbcon.exe_proc_para(query, p);
        }
    }
}
